package com.googlecode.dgwt.client.dojo.data.model;

import com.google.gwt.dom.client.Element;
import com.googlecode.dgwt.client.dijit.View;
import com.googlecode.dgwt.client.dojo.data.listener.AttachListener;
import com.googlecode.dgwt.client.dojo.exception.ValidationException;

/**
 * @author wellsantos@wellsantos.com
 * @since 0.01
 */
public interface StoreColumn<Item,Type> extends AttachListener<StoreModel<Item,?>> {

    public Type getValue(Item item);

    public boolean setValue(Item item, Type value);

    public String getDisplayValue(Item item);
    
    public void setDisplayValue(Item item, String value) throws ValidationException;
    
    public void onRegisterParent(View parentView, boolean registered);
    
    public void onUpdateColumn(View parentView, Element element, Item item);
    
    public void onFormatColumn(Element element, Item item);
    
    public void refreshValues();

    public int getColumnIndex();
    
    public Class<? extends Type> getColumnType();
    
    public boolean isReadOnly();
    
}
